/**
 * Created by victor on 16/9/14.
 */
module.exports = {
    extend:function (target,source,flag) {
        for (var key in source){
            if (source.hasOwnProperty(key)){
                flag ?
                    (target[key] = source[key]) :
                    (target[key] == void 0 && (target[key] = source));
            }
        }
        return target;
    }
}